package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SmsControllerApi;
import com.nineclock.system.service.SMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sms")
public class SmsController implements SmsControllerApi {
    @Autowired
    private SMSService smsControllerService;
    @Override
    @GetMapping("/code")
    public Result createSmsCode(String mobile, String type) {
        smsControllerService.createSmsCode(mobile,type);
        return Result.success();
    }

    @Override
    @GetMapping("/verify")
    public Result verify(String mobile, String type, String checkcode) {
        smsControllerService.verify(mobile,checkcode,type);
        return Result.success(true);
    }
}
